<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>找回密码</title>
    <link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/bootstrap.css"/>
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/icheck.css"/>
<script src="/WebYiZhi/Template/Home/Js/jquery-2.1.1.js"></script>
<script src="/WebYiZhi/Template/Home/Js/bootstrap.js"></script>
<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/jquery.form/3.46.0/jquery.form.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
<script>DD_belatedPNG.fix('.pngfix,.icon');</script>
<![endif]-->
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>

<![endif]-->
<script src="/WebYiZhi/Public/layer/layer.js"></script>
<!--自己的css-->
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/login.css"/>
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/style.css"/>
<script src="/WebYiZhi/Template/Home/Js/message.js"></script>
<script type="text/javascript" src="/WebYiZhi/Template/Home/Js/Validform_v5.3.2_min.js"></script>
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/index.css"/>
<script src="/WebYiZhi/Template/Home/Js/Chart.js"></script>
<script src="/WebYiZhi/Template/Home/Js/Chart-1.0.1-beta.4.js"></script>
<script src="/WebYiZhi/Template/Home/Js/index.js"></script>
<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/My97DatePicker/WdatePicker.js"></script>

</head>
<body>
<!--顶部开始-->
<header class="header">
    <div class="header_box">
        <div class="header_cont">
            <div class="head_l lt">您好！欢迎来到移植网</div>
            <div class="head_r rt"><a href="<?php echo U(login);?>">登录</a><a href="<?php echo U(register);?>">注册</a></div>
        </div>
    </div>
    <div class="header_logo">
        <div class="lt">
            <a href=""><img src="/WebYiZhi/Template/Home/Img/LOGO.png" alt=""/></a>
            <span>移植助手</span>
        </div>
        <div class="rt">
            <ul>
                <li>没有账号？<a href="<?php echo U(register);?>">立即注册</a><span>|</span></li>
                <li>忘记密码？<a href="<?php echo U(pwd);?>">立即找回</a></li>
                <li class="btn_index"><a href="<?php echo U(index);?>">返回介绍页</a></li>
            </ul>
        </div>
    </div>
</header>
<!--顶部结束-->
<!--主体内容开始-->
<div class="pwd_main register preset">
    <div class="row bt">
        <div class="col-xs-2"></div>
        <div class="col-xs-9"><span class="glyphicon glyphicon-lock" style="color:#e4393c; margin-right:10px;"></span>找回密码</div>
    </div>
    <div class="row">
        <div class="col-xs-3"></div>
        <div class=" col-xs-9" style="margin:15px 0;">找回您的密码<span style="color: red;">（以下信息*皆为必填项，请认真填写）</span></div>
    </div>
    <form  class="form form-horizontal va-m Validform " id="demoform-1" >
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;手机号码：</label>
            <div class="col-xs-5">
                <input type="text" class="form-control" id="phone" name="phone" autocomplete="off" placeholder="请输入手机号码" datatype="m" errormsg="请输入正确的手机号">
            </div>
            <div class="col-xs-3">
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;验证码：</label>
            <div class="col-xs-2">
                <input type="text" class="form-control"  id="messages" name="messages" autocomplete="off" placeholder="请输入验证码" datatype="n6-6" errormsg="请输入验证码" disabled>
            </div>
            <div class="col-xs-2">
            </div>
            <div class="col-xs-1 ">
                <input class="btn btn-primary radius" type="button" style="background: #00b683;border-color: #00b683;margin-left: -51%" value="获取验证码" onclick="sendmsg(this)">
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;重置密码：</label>
            <div class="col-xs-5">
                <input type="password" class="form-control" name="passwd" id="passwd" autocomplete="off" placeholder="再次输入密码 " datatype="s6-12" nullmsg="请输入6-12位字符" errormsg="密码至少6个字符,最多12个字符">
            </div>
            <div class="col-xs-3">
            </div>
        </div>
        <div class="form-group" style="margin-top: 50px">
            <div class="col-xs-2 col-xs-offset-4">
                <input class="btn btn-primary form-control"   value="立即重置"  onclick="resetpwd()"  style="background: #00b683;border-color: #00b683;padding: 0 40px">
            </div>
        </div>
    </form>
</div>
<!--主体内容结束-->
<!--尾部开始-->
<div class="footer">
    <div class="footer_cont">
        <p>Copyright © 2008-2014 Change360.cn All Rights Reserved  陕西类星体信息科技有限公司</p>
        <p> 地址：陕西省西安市高新区高新一路正信大厦A座204室</p>
    </div>
</div>
<script>
    $(".Validform").Validform({
        tiptype:2
    });
</script>
<!--尾部结束-->
</body>
<script>
    $(".pwdform").Validform({
        tiptype:2
    });
    function  sendmsg(obj) {
        var ajaxurl = "<?php echo U(sendmsg);?>";
        $phone=$("#phone").val();
        if(verification($phone)){
            $("#messages").removeAttr("disabled");
            $.ajax({
                url:ajaxurl,
                data:{
                    phone:$phone
                },
                type:"Post",
                dataType:"json",
                success:function(data){
                    layer.msg(data.msg);
                    settime(obj);
                }
            });
        }else{
            layer.msg('请输入正确的手机号!')
        }
    }
    /**
     * 重置密码
     */
    function  resetpwd() {
        $phone=$("#phone").val();
        if(verification($phone) && $("#messages").val() && $("#passwd").val()){
            var url = "<?php echo U('DoctorInfo/restpassword');?>";
            $.ajax({
                url:url,
                type:"Post",
                data: $("#demoform-1").serialize(),
                dataType:"json",
                success: function(data) {
                    if(data.status==1){
                        layer.msg(data.msg, function(){
                            window.location.href="<?php echo U('login');?>";
                        });
                    }else{
                        layer.msg(data.msg);
                    }
                },
                error:function () {
                    layer.msg('请检查您的验证码是否正确');
                }
            });
        }else{
            layer.msg('请完善你的修改信息!');
        }
    }
</script>
</html>